#!/usr/bin/env python
# -*- coding: utf-8 -*-

import smtplib
import string


class email:

    def __init__(self,host,subject,to,fr,text,password,mail):
        self.host = host
        self.subject = subject
        self.to = to
        self.fr = fr
        self.text = text
        self.mail = mail
        self.password = password

    def send(self):
        body = string.join(("From: %s\nTo: %s\nSubject: %s\n\n%s" % (self.fr,self.to,self.subject,self.body)),"\r\n")
        server = smtplib.SMTP()
        server.connect(self.host,"25")
        server.starttls()
        server.login(self.mail,self.password)
        server.sendmail(self.fr,self.to,body)
        server.quit()


if __name__ == '__main__':
    mail = email("smtp.gmail.com","test","","","test","","")
    mail.send()